#include "RSolvePnp.h"
using namespace RobotVision;

void RobotVision::RSolvePnp::Initialize(RSolvePnpParam* model)
{
    m_InParams = model;
    //m_InParams->ObjectPoint3D = model.ObjectPoint3D;
}

void RobotVision::RSolvePnp::Run()
{
    solvePnP();
}

bool RobotVision::RSolvePnp::solvePnP()
{
    Mat t;
    Mat r;
    bool result=cv::solvePnP(m_InParams->ObjectPoint3D, m_InParams->ImagePoint2D, m_InParams->CameraMatrix, m_InParams->DistCoeffs, r, t);
    r.copyTo(m_Result->Rvec);
    t.copyTo(m_Result->Tvec);
    return result;
}
